<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML>
<html>
<head>
<%@ include file="/WEB-INF/jsp/inc/taglibs.jsp"%>
	<%@ include file="/WEB-INF/jsp/inc/meta.jsp"%>
  <script type="text/javascript">
   function checkAll(val){
    //alert(val);
    if(val)
      $('input[name=ids]').each(function(){
           $(this).attr('checked',true);
      })
     else
    	 $('input[name=ids]').each(function(){
             $(this).attr('checked',false);
        })  
   }
   function gotopage()
   {
      var page=$('#topage').val();
      var url='${approot}/admin/money/list/page/'+page;
     // alert(url);
      window.location.href=url;
   }
	//清空恢复表单原始数据
   function formreset()
	{
		$("input[type=text]").val(""); 
		$("#type").val("0");
	}

   //批量删除
   function delete_batch(){
    var count=0;
    $('input[name=ids]:checked').each(function(){
        count=count+1;
    })
    if(count==0)
    {
        alert("请至少选中一条记录");
        return false;
    }else
    {
        var ids="";
        $("input[name='ids']:checked").each(function(){
           ids=ids+$(this).val()+"_";
        })
        var url='${approot}/admin/surrogate/delete_batch/'+ids;
        //alert(url);
        //window.location.href=url;

    }

   }
   
   
   function delete_money(id){  
   		if(confirm('删除后不可恢复,您确认删除该客户信息以及此客户的卡信息、地址信息?')){
  		 	$.ajax({
	 		   	url:'${approot}/admin/surrogate/delete',
	 		   	dataType: 'json',
	 		   	contentType: 'application/json',
	 			data:null,
	 			type:'post',
	 			beforeSend:function(){
	 			  // $('#main').disabled='true';
	 			},
	 			error:function(request){
	 				//alert(S);
	 			},
	 			success:function(data){
	 			   if(data.msg=="error")
	 			   {
	 	 			   alert('删除失败');
	 			   }
	 			   if(data.msg=="succ")
	 			   {
	 				  alert('删除成功');
	 			   }
	 			   window.location.reload();
	 			}
	 		   });
  		 } 
      
   }
   
   function to_up_csv(){
   		window.open('${approot}/admin/surrogate/to_up_csv','_blank','height=1,width=500,toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,status=no,left=600,top=400');
   }
   </script>
</head>  
 <body style="background:#E8F5FE; padding:15px 18px;" class="scroll_r">

<form method="post" action="${approot}/admin/surrogate/list/form/0" id="surrogateBean">

<table border="0" cellpadding="0" cellspacing="1" width="92%" align="center" id="add_tab">

<tr>

<th>用户名：</th>
<td><input type="text" id="name" name="name"  value="${surrogateBean.name}"/>
</td>

<th>查询时间：</th>
<td> <input type="text" id="startTime" name="startTime"  value="${surrogateBean.strStartDate}" class="Wdate" onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'endTime\')}',startDate:'%y-%M-01 00:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate:true})"/> </td>
<th>至</th>
<td> <input type="text" id="endTime" name="endTime" value="${surrogateBean.strEndDate}" class="Wdate" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'startTime\')}',startDate:'%y-%M-01 00:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate:true})"/> </td>
</tr>
<tr>
<td colspan="6" style="text-align: center">
<input type="submit" class="but" value="开始查询">
<input type="button" class="but" onclick="formreset();" value="重置条件">

</td>

</tr>

</table>
</form>


<c:choose>
<c:when test="${fn:length(page.items)<1}">
<div align="center"><font color='red'>对不起,暂时没有找到符合条件的数据!</font></div>
</c:when>
<c:otherwise> 
<table border="0" cellpadding="" cellspacing="1" align="center" width="92%" id="web_tab">
 <caption style="text-align: right;margin-bottom:4px;"><button class="but" onclick="return to_up_csv();">导入CSV文件</button></caption>
 <tr>
  
  <th>指令序号</th>
   <th>缴费编号</th>
  <th>缴费种类</th>
  <th>协议编号</th>
  <th>币种</th>
  <th>收费账号</th>
  <th>收费单位</th>
  <th>付费账号</th>
  <th>付费户名</th>
  <th>付款金额</th>
  <th>用途</th>
  <th>银行反馈</th>
  <th>自定义序号</th>
  <th>付款通知手机</th>
  <th>是否短信通知</th>
  <th>批次号</th>
  <th>银行代理流水</th>
  <th>查询时间</th>
 </tr>
<c:forEach var="surrogate" items="${page.items}">
 <tr>
  
  <td>
   ${surrogate.dictateNumber}
  </td> <td>
   ${surrogate.payNumber}
  </td> <td>
   ${surrogate.payType}
  </td> <td>
   ${surrogate.protocolNumber}
  </td> <td>
   ${surrogate.moneyType}
  </td><td>
   ${surrogate.chargeCard}
  </td><td>
   ${surrogate.chargeUnit}
  </td><td>
   ${surrogate.payCard}
  </td><td>
   ${surrogate.payPerson}
  </td><td>
   ${surrogate.payMoney}
  </td><td>
   ${surrogate.purpose}
  </td><td>
   ${surrogate.bankFeedback}
  </td><td>
   ${surrogate.customNumber}
  </td><td>
   ${surrogate.sendMobile}
  </td><td>
   ${surrogate.sendFlag}
  </td>
  <td>
   ${surrogate.batchNumber}
  </td>
  <td>
   ${surrogate.surrogateNumber}
  </td>
  <td><fmt:formatDate value="${surrogate.queryTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
 </tr>
 </c:forEach>
</table>

<table border="0" cellpadding="0" cellspacing="1" width="92%" align="center">
   <tr>
    <td align="left">共有<font color='red'>${page.totalCount}</font> 条记录，当前第<font color='red'>${page.currentPage}</font>页，共 <font color='red'>${page.pageCount}</font>页</td>
	<td align="right">
	 转到
	 <select name="topage" id="topage" onchange="gotopage();">
	 <c:forEach var="ind" items="${page.pages}">
	 <option value="${(ind-1)*page.pageSize}" <c:if test="${ind==page.currentPage}">selected="selected"</c:if>>${ind}</option>
	 </c:forEach>
	 </select>
	
	<button class="but" onclick="window.location.href='${approot}/admin/surrogate/list/page/${page.firstIndex}'">首页</button> 
	<button class="but" onclick="window.location.href='${approot}/admin/surrogate/list/page/${page.previousIndex}'">上一页</button>
	<c:forEach items="${page.showpages}" var="ind">
	<c:if test="${ind!=0}">
	<a href="${approot}/admin/surrogate/list/page/${(ind-1)*page.pageSize}">${ind}</a>
	</c:if>
	</c:forEach>
	<button class="but" onclick="window.location.href='${approot}/admin/surrogate/list/page/${page.nextIndex}'">下一页</button>
	<button class="but" onclick="window.location.href='${approot}/admin/surrogate/list/page/${page.lastIndex}'">末页</button>  
	
	 </td>
   </tr>
</table>
</c:otherwise>
</c:choose>
</body>
</html>
